﻿using HuaHan.WorkTicket.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuaHan.WorkTicket.Domain.Repositories.EntityFramework.ModelConfigurations
{
    public class ColorConfiguration : BaseConfiguration<Color>
    {
        public ColorConfiguration()
            : base()
        {
            this.ToTable("tblColor");
            this.HasKey<Guid>(c => c.ColorID);
            this.Property(c => c.ColorID)
                .IsRequired();
            //.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(c => c.Name)
                .IsRequired()
                .HasMaxLength(20);
            this.Property(c => c.Description)
                .HasMaxLength(50);
        }
    }
}
